{% extends "BackendBundle::backend.html.twig" %}

{% block title "Gestión de Usuarios" %}

{% block header %}

    {% set vars = {'ruta' : app.request.attributes.get('_route')} %}
    {% include "BackendBundle::topmenu.html.twig" with vars %}

{% endblock %}

{% block left %}

    {% set vars = {'ruta' : app.request.attributes.get('_route')} %}
    {% include "UsersBundle:Default:menuleft.html.twig" with vars %}

{% endblock %}

{% block content %}
      
    <div class="span9">

        {% if modi == 0 %}
          <h2>{{"Editar Usuario"|trans}}</h2>
        {% elseif modi == 1 %}
          <h2>{{"Añadir Usuario"|trans}}</h2>
        {% endif %}

        {% if modi == 0 %}
          <form action="{{ path('UsersBundle_editar_save') }}" class="form-horizontal" name="formUsers" id="formUsers" method="post">
        {% elseif modi == 1 %}
          <form action="{{ path('UsersBundle_formulario_alta_save') }}" class="form-horizontal" name="formUsers" id="formUsers" method="post">
        {% endif %}
            
          <fieldset>
            <legend>{{ "Información personal"|trans }}</legend>
            <div class="control-group">
              <label class="control-label" for="nombre">{{ "Nombre"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="nombre" id="nombre" value="" type="text" />
              </div>
           </div>             

            <div class="control-group">              
              <label class="control-label" for="apellidos">{{ "Apellidos"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="apellidos" id="apellidos" value="" type="text" />
              </div>              
            </div>
              
            <div class="control-group">              
              <label class="control-label" for="email">{{ "Email"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="email" id="email" value="" type="text" />
              </div>              
            </div>
              
            <div class="control-group">               
              <label class="control-label" for="telefono">{{ "Teléfono"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="telefono" id="telefono" value="" type="text" />
              </div>              
            </div>
            
            <div class="control-group">              
              <label class="control-label" for="foto">{{ "Foto"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="foto" id="foto" value="" type="file" />
              </div>              
            </div>               
          </fieldset>
            
          <fieldset>
          <legend>{{ "Identificación"|trans }}</legend>  
            <div class="control-group">   
              <label class="control-label" for="usuario">{{ "Usuario"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="usuario" id="usuario" value="" type="text" />
              </div>                      
            </div>
            
            <div class="control-group"> 
              <label class="control-label" for="password">{{ "Password"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="password" id="password" value="" type="password" />
              </div>
            </div>
              
            <div class="control-group">             
              <label class="control-label" for="pregunta_clave">{{ "Pregunta clave"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="pregunta_clave" id="pregunta_clave" value="" type="text" />
              </div>              
            </div>

            <div class="control-group">              
              <label class="control-label" for="respuesta">{{ "Respuesta"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="respuesta" id="respuesta" value="" type="text" />
              </div>              
            </div>
          </fieldset>              
              
          <fieldset>
            <legend>{{ "Permisos"|trans }}</legend>                    
            <div class="control-group">              
              <label class="control-label" for="estado">{{ "Estado"|trans }}</label>
              <div class="controls">
                <select class="input-small" name="estado" id="estado">
                  <option value="1">{{ "Activo"|trans }}</option>
                  <option value="0">{{ "Inactivo"|trans }}</option>
                </select>
              </div>              
            </div>            
              
            <div class="control-group">              
              <label class="control-label" for="role">{{ "Role"|trans }}</label>
              <div class="controls">
                <select class="input-medium" name="role" id="role">
                  <option value="1">User</option>
                  <option value="1">SEO/SEM</option>
                  <option value="1">Editor</option>
                  <option value="1">Admin</option>
                  <option value="1">Superadmin</option>
                </select>
              </div>              
            </div>
                          
            <div class="control-group">              
              <label class="control-label" for="password">{{ "Nivel Acceso"|trans }}</label>
              <div class="controls">
                 <div class="input-prepend input-append">
                   <div class="btn"><i class="icon icon-chevron-left"></i></div>                 
                     <input class="span3" id="appendedPrependedInput" size="16" type="text" value="1">
                   <div class="btn"><i class="icon icon-chevron-right"></i></div>
                 </div>
              </div>              
            </div>   
                                      
            <div class="control-group">              
              <label class="control-label" for="ambito">{{ "Ámbito"|trans }}</label>
              <div class="controls">
                <input class="input-xlarge" name="ambito" id="ambito" value="" type="text" />
              </div>              
            </div>
                        
                <div class="form-actions">
                    <input class="btn btn-primary" name="UsersSave" value="{{ "Guardar"|trans }}" type="submit">
                    <a href="{{ path('UsersBundle_homepage') }}" class="btn">{{ "Cancelar"|trans }}</a>
                </div>
             </fieldset>             
        </form>      
    </div>
{% endblock %}